package com.my.kq.service;

import com.my.kq.dao.EmployeeDao;
import com.my.kq.entity.*;

import java.util.List;

public class EmployeeService {
    private EmployeeDao EmployeeDao=new EmployeeDao();
    public Employee dlu(String employeeNumber, String password) throws Exception {
        Employee dlu = EmployeeDao.dlu(employeeNumber, password);
        return dlu;
    }

    public Employee Empcx(Integer id) throws Exception {
        Employee one=  EmployeeDao.Empcx(id);
        return one;
    }

    public Employee getEmployee(int eNum) throws Exception {
        Employee employee = EmployeeDao.getEmployee(eNum);
        return employee;
    }

    public int empUpdate(Integer id, String employeeNumber, String name, String password, String gender, String date, String telephone, String email, String address, String education,String s,String notes) throws Exception {
        int num= EmployeeDao.empUpdate(id,employeeNumber,name,password,gender,date,telephone,email,address,education,s,notes);

        return num;
    }
    //分页查询员工信息列表
    public List<EmployeeListDTO> getPageList(int pageNo) throws Exception {
        return EmployeeDao.getPageList(pageNo);
    }
    //总记录条数
    public int getCount() throws Exception {
        return EmployeeDao.getTotal();
    }
    //单个查询
    public EmployeeQueryDTO getEmployeeById(int employee_number) throws Exception {
        return EmployeeDao.getEmployeeById(employee_number);
    }
    //删除
    public void EmployeeDelById(String employee_number) throws Exception {
        EmployeeDao.EmployeeDelById(employee_number);
    }
    //添加
    public void addEmploy(Employee employee) throws Exception {
        EmployeeDao.addEmploy(employee);
    }
    //查询部门名称
    public List<Department> selectBuMen() throws Exception {
        return EmployeeDao.selectBuMen();
    }
    //查询职称名称
    public List<Position> selectZhiCheng() throws Exception {
        return EmployeeDao.selectZhiCheng();
    }
    //查询最大工号值
    public Integer gonghao() throws Exception{
        return EmployeeDao.gonghao();
    }
    //预修改
    public Employee yuXiuGai(String employee_number) throws Exception {
        return EmployeeDao.yuXiuGai(employee_number);
    }
    //修改
    public void updateYuanGong(String employeeNumber, String name, String password, String gender, String brithday, String telephone, String email, String address, String education, String positionNumber, String notes) throws Exception {
        EmployeeDao.updateYuanGong(employeeNumber,name,password,gender,brithday,telephone,email,address,education,positionNumber,notes);
    }



}
